﻿using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
using System.Windows.Forms;

namespace BackupRestoreSoftwares.FormChild
{
    public partial class m_Photoshop : UserControl
    {
        private readonly string App_path = Application.StartupPath;
        private readonly bool Is64 = Environment.Is64BitOperatingSystem;
        private readonly string Program_32 = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
        private readonly string Program_64 = Path.GetPathRoot(Environment.SystemDirectory) + "Program Files";
        private readonly string Roaming_path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
        private string Common_path = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
        private string Local_path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);

        public m_Photoshop()
        {
            InitializeComponent();
        }

        private void m_Photoshop_Load(object sender, EventArgs e)
        {
            if (File.Exists(App_path + @"\DBBACKUP") != true)
            {
                Directory.CreateDirectory(App_path + @"\DBBACKUP");
            }
        }

        private void btn_bk_pts7_Click(object sender, EventArgs e)
        {
            DialogResult result = EasyDialog.ShowYesNoBackup("Photoshop");
            if (result == DialogResult.Yes)
            {
                if (File.Exists(App_path + @"\DBBACKUP\Photoshop") != true)
                {
                    Directory.CreateDirectory(App_path + @"\DBBACKUP\Photoshop");
                }
                try
                {
                    var t = new Thread(frmMain.waitscreen);
                    t.Start();

                    string chkfile_32 = Program_32 + @"\Adobe\Photoshop 7.0\Photoshop.exe";
                    if (File.Exists(chkfile_32))
                    {
                        foreach (Process app in Process.GetProcesses())
                            if (app.ProcessName == "photoshop")
                                app.Kill();
                        string rar_file = App_path + @"\DBBACKUP\Photoshop\PTS7.rar";
                        string path_file = Roaming_path + @"\Adobe\Photoshop\7.0\";
                        EasyRAR.Compress(rar_file, path_file);

                        t.Abort();
                        MessageBox.Show("Backup completed!", "Finish");
                    }
                    else
                    {
                        t.Abort();
                        MessageBox.Show("Adobe Photoshop 7 don't install!", "Error");
                    }
                }
                catch
                {
                    MessageBox.Show("Error! Please contact: caiwindao@outlook.com", "Error");
                }
            }
        }

        private void btn_res_pts7_Click(object sender, EventArgs e)
        {
            DialogResult result = EasyDialog.ShowYesNoRestore("Photoshop");
            if (result == DialogResult.Yes)
            {
                try
                {
                    var t = new Thread(frmMain.waitscreen);
                    t.Start();

                    string chkfile_32 = Program_32 + @"\Adobe\Photoshop 7.0\Photoshop.exe";
                    if (File.Exists(chkfile_32))
                    {
                        foreach (Process app in Process.GetProcesses())
                            if (app.ProcessName == "photoshop")
                                app.Kill();
                        string rar_file = App_path + @"\DBBACKUP\Photoshop\PTS7.rar";
                        string path_file = Roaming_path + @"\Adobe\Photoshop\7.0\";
                        EasyRAR.Extract(rar_file, path_file);

                        t.Abort();
                        MessageBox.Show("Restore completed!", "Finish");
                    }
                    else
                    {
                        t.Abort();
                        MessageBox.Show("Adobe Photoshop 7 don't install!", "Error");
                    }
                }
                catch
                {
                    MessageBox.Show("Error! Please contact: caiwindao@outlook.com", "Error");
                }
            }
        }

        private void btn_bk_pts8_Click(object sender, EventArgs e)
        {
            DialogResult result = EasyDialog.ShowYesNoBackup("Photoshop 8");
            if (result == DialogResult.Yes)
            {
                if (File.Exists(App_path + @"\DBBACKUP\Photoshop") != true)
                {
                    Directory.CreateDirectory(App_path + @"\DBBACKUP\Photoshop");
                }
                try
                {
                    var t = new Thread(frmMain.waitscreen);
                    t.Start();

                    string chkfile_32 = Program_32 + @"\Adobe\Photoshop cs\Photoshop.exe";
                    if (File.Exists(chkfile_32))
                    {
                        foreach (Process app in Process.GetProcesses())
                            if (app.ProcessName == "photoshop")
                                app.Kill();
                        string rar_file = App_path + @"\DBBACKUP\Photoshop\PTS8.rar";
                        string path_file = Roaming_path + @"\Adobe\Photoshop\8.0\";
                        EasyRAR.Compress(rar_file, path_file);

                        t.Abort();
                        MessageBox.Show("Backup completed!", "Finish");
                    }
                    else
                    {
                        t.Abort();
                        MessageBox.Show("Adobe Photoshop 8 don't install!", "Error");
                    }
                }
                catch
                {
                    MessageBox.Show("Error! Please contact: caiwindao@outlook.com", "Error");
                }
            }
        }

        private void btn_res_pts8_Click(object sender, EventArgs e)
        {
            DialogResult result = EasyDialog.ShowYesNoRestore("Photoshop 8");
            if (result == DialogResult.Yes)
            {
                try
                {
                    var t = new Thread(frmMain.waitscreen);
                    t.Start();

                    string chkfile_32 = Program_32 + @"\Adobe\Photoshop cs\Photoshop.exe";
                    if (File.Exists(chkfile_32))
                    {
                        foreach (Process app in Process.GetProcesses())
                            if (app.ProcessName == "photoshop")
                                app.Kill();
                        string rar_file = App_path + @"\DBBACKUP\Photoshop\PTS8.rar";
                        string path_file = Roaming_path + @"\Adobe\Photoshop\8.0\";
                        EasyRAR.Extract(rar_file, path_file);

                        t.Abort();
                        MessageBox.Show("Restore completed!", "Finish");
                    }
                    else
                    {
                        t.Abort();
                        MessageBox.Show("Adobe Photoshop 8 don't install!", "Error");
                    }
                }
                catch
                {
                    MessageBox.Show("Error! Please contact: caiwindao@outlook.com", "Error");
                }
            }
        }

        private void btn_bk_pts9_Click(object sender, EventArgs e)
        {
            DialogResult result = EasyDialog.ShowYesNoBackup("Photoshop 9");
            if (result == DialogResult.Yes)
            {
                if (File.Exists(App_path + @"\DBBACKUP\Photoshop") != true)
                {
                    Directory.CreateDirectory(App_path + @"\DBBACKUP\Photoshop");
                }
                try
                {
                    var t = new Thread(frmMain.waitscreen);
                    t.Start();

                    string chkfile_32 = Program_32 + @"\Adobe\Adobe Photoshop CS2\Photoshop.exe";
                    if (File.Exists(chkfile_32))
                    {
                        foreach (Process app in Process.GetProcesses())
                            if (app.ProcessName == "photoshop")
                                app.Kill();
                        string rar_file = App_path + @"\DBBACKUP\Photoshop\PTS9.rar";
                        string path_file = Roaming_path + @"\Adobe\Photoshop\9.0\";
                        EasyRAR.Compress(rar_file, path_file);

                        t.Abort();
                        MessageBox.Show("Backup completed!", "Finish");
                    }
                    else
                    {
                        t.Abort();
                        MessageBox.Show("Adobe Photoshop 9 don't install!", "Error");
                    }
                }
                catch
                {
                    MessageBox.Show("Error! Please contact: caiwindao@outlook.com", "Error");
                }
            }
        }

        private void btn_res_pts9_Click(object sender, EventArgs e)
        {
            DialogResult result = EasyDialog.ShowYesNoRestore("Photoshop 9");
            if (result == DialogResult.Yes)
            {
                try
                {
                    var t = new Thread(frmMain.waitscreen);
                    t.Start();

                    string chkfile_32 = Program_32 + @"\Adobe\Adobe Photoshop CS2\Photoshop.exe";
                    if (File.Exists(chkfile_32))
                    {
                        foreach (Process app in Process.GetProcesses())
                            if (app.ProcessName == "photoshop")
                                app.Kill();
                        string rar_file = App_path + @"\DBBACKUP\Photoshop\PTS9.rar";
                        string path_file = Roaming_path + @"\Adobe\Photoshop\9.0\";
                        EasyRAR.Extract(rar_file, path_file);

                        t.Abort();
                        MessageBox.Show("Restore completed!", "Finish");
                    }
                    else
                    {
                        t.Abort();
                        MessageBox.Show("Adobe Photoshop 9 don't install!", "Error");
                    }
                }
                catch
                {
                    MessageBox.Show("Error! Please contact: caiwindao@outlook.com", "Error");
                }
            }
        }

        private void btn_bk_ptscs3_Click(object sender, EventArgs e)
        {
            DialogResult result = EasyDialog.ShowYesNoBackup("Photoshop CS3");
            if (result == DialogResult.Yes)
            {
                if (File.Exists(App_path + @"\DBBACKUP\Photoshop") != true)
                {
                    Directory.CreateDirectory(App_path + @"\DBBACKUP\Photoshop");
                }
                try
                {
                    var t = new Thread(frmMain.waitscreen);
                    t.Start();

                    string chkfile_32 = Program_32 + @"\Adobe\Adobe Photoshop CS3\Photoshop.exe";
                    if (File.Exists(chkfile_32))
                    {
                        foreach (Process app in Process.GetProcesses())
                            if (app.ProcessName == "photoshop")
                                app.Kill();
                        string rar_file = App_path + @"\DBBACKUP\Photoshop\PTSCS3.rar";
                        string path_file = Roaming_path + @"\Adobe\Adobe Photoshop CS3\Adobe Photoshop CS3 Settings\";
                        EasyRAR.Compress(rar_file, path_file);

                        t.Abort();
                        MessageBox.Show("Backup completed!", "Finish");
                    }
                    else
                    {
                        t.Abort();
                        MessageBox.Show("Adobe Photoshop CS 3 don't install!", "Error");
                    }
                }
                catch
                {
                    MessageBox.Show("Error! Please contact: caiwindao@outlook.com", "Error");
                }
            }
        }

        private void btn_res_cs3_Click(object sender, EventArgs e)
        {
            DialogResult result = EasyDialog.ShowYesNoRestore("Photoshop CS3");
            if (result == DialogResult.Yes)
            {
                try
                {
                    var t = new Thread(frmMain.waitscreen);
                    t.Start();

                    string chkfile_32 = Program_32 + @"\Adobe\Adobe Photoshop CS3\Photoshop.exe";
                    if (File.Exists(chkfile_32))
                    {
                        foreach (Process app in Process.GetProcesses())
                            if (app.ProcessName == "photoshop")
                                app.Kill();
                        string rar_file = App_path + @"\DBBACKUP\Photoshop\PTSCS3.rar";
                        string path_file = Roaming_path + @"\Adobe\Adobe Photoshop CS3\Adobe Photoshop CS3 Settings\";
                        EasyRAR.Extract(rar_file, path_file);

                        t.Abort();
                        MessageBox.Show("Restore completed!", "Finish");
                    }
                    else
                    {
                        t.Abort();
                        MessageBox.Show("Adobe Photoshop CS 3 don't install!", "Error");
                    }
                }
                catch
                {
                    MessageBox.Show("Error! Please contact: caiwindao@outlook.com", "Error");
                }
            }
        }

        private void btn_bk_cs4_Click(object sender, EventArgs e)
        {
            DialogResult result = EasyDialog.ShowYesNoBackup("Photoshop CS4");
            if (result == DialogResult.Yes)
            {
                if (File.Exists(App_path + @"\DBBACKUP\Photoshop") != true)
                {
                    Directory.CreateDirectory(App_path + @"\DBBACKUP\Photoshop");
                }
                try
                {
                    var t = new Thread(frmMain.waitscreen);
                    t.Start();

                    string chkfile_32 = Program_32 + @"\Adobe\Photoshop cs4\Photoshop.exe";
                    if (File.Exists(chkfile_32))
                    {
                        foreach (Process app in Process.GetProcesses())
                            if (app.ProcessName == "photoshop")
                                app.Kill();
                        string rar_file = App_path + @"\DBBACKUP\Photoshop\PTSCS4.rar";
                        string path_file = Roaming_path + @"\Adobe\Adobe Photoshop CS4\Adobe Photoshop CS4 Settings\";
                        EasyRAR.Compress(rar_file, path_file);

                        t.Abort();
                        MessageBox.Show("Backup completed!", "Finish");
                    }
                    else
                    {
                        t.Abort();
                        MessageBox.Show("Adobe Photoshop CS 4 don't install!", "Error");
                    }
                }
                catch
                {
                    MessageBox.Show("Error! Please contact: caiwindao@outlook.com", "Error");
                }
            }
        }

        private void btn_res_cs4_Click(object sender, EventArgs e)
        {
            DialogResult result = EasyDialog.ShowYesNoRestore("Photoshop CS4");
            if (result == DialogResult.Yes)
            {
                try
                {
                    var t = new Thread(frmMain.waitscreen);
                    t.Start();

                    string chkfile_32 = Program_32 + @"\Adobe\Photoshop cs4\Photoshop.exe";
                    if (File.Exists(chkfile_32))
                    {
                        foreach (Process app in Process.GetProcesses())
                            if (app.ProcessName == "photoshop")
                                app.Kill();
                        string rar_file = App_path + @"\DBBACKUP\Photoshop\PTSCS4.rar";
                        string path_file = Roaming_path + @"\Adobe\Adobe Photoshop CS4\Adobe Photoshop CS4 Settings\";
                        EasyRAR.Extract(rar_file, path_file);

                        t.Abort();
                        MessageBox.Show("Restore completed!", "Finish");
                    }
                    else
                    {
                        t.Abort();
                        MessageBox.Show("Adobe Photoshop CS 4 don't install!", "Error");
                    }
                }
                catch
                {
                    MessageBox.Show("Error! Please contact: caiwindao@outlook.com", "Error");
                }
            }
        }

        private void btn_bk_cs5_Click(object sender, EventArgs e)
        {
            DialogResult result = EasyDialog.ShowYesNoBackup("Photoshop CS5");
            if (result == DialogResult.Yes)
            {
                if (File.Exists(App_path + @"\DBBACKUP\Photoshop") != true)
                {
                    Directory.CreateDirectory(App_path + @"\DBBACKUP\Photoshop");
                }
                try
                {
                    var t = new Thread(frmMain.waitscreen);
                    t.Start();

                    if (Is64)
                    {
                        string chkfile_64 = Program_64 + @"\Adobe\Adobe Photoshop CS5 (64 Bit)\Photoshop.exe";
                        string chkfile_32 = Program_32 + @"\Adobe\Photoshop cs5\Photoshop.exe";
                        if (File.Exists(chkfile_64) || File.Exists(chkfile_32))
                        {
                            foreach (Process app in Process.GetProcesses())
                                if (app.ProcessName == "photoshop")
                                    app.Kill();
                            string rar_file = App_path + @"\DBBACKUP\Photoshop\PTSCS5.rar";
                            string path_file = Roaming_path +
                                               @"\Adobe\Adobe Photoshop CS5\Adobe Photoshop CS5 Settings\";
                            EasyRAR.Compress(rar_file, path_file);

                            t.Abort();
                            MessageBox.Show("Backup completed!", "Finish");
                        }
                        else
                        {
                            t.Abort();
                            MessageBox.Show("Adobe Photoshop CS5 don't install!", "Error");
                        }
                    }
                    else
                    {
                        string chkfile_32 = Program_32 + @"\Adobe\Photoshop cs5\Photoshop.exe";
                        if (File.Exists(chkfile_32))
                        {
                            foreach (Process app in Process.GetProcesses())
                                if (app.ProcessName == "photoshop")
                                    app.Kill();
                            string rar_file = App_path + @"\DBBACKUP\Photoshop\PTSCS5.rar";
                            string path_file = Roaming_path +
                                               @"\Adobe\Adobe Photoshop CS5\Adobe Photoshop CS5 Settings\";
                            EasyRAR.Compress(rar_file, path_file);

                            t.Abort();
                            MessageBox.Show("Backup completed!", "Finish");
                        }
                        else
                        {
                            t.Abort();
                            MessageBox.Show("Adobe Photoshop CS5 don't install!", "Error");
                        }
                    }
                }
                catch
                {
                    MessageBox.Show("Error! Please contact: caiwindao@outlook.com", "Error");
                }
            }
        }

        private void btn_res_cs5_Click(object sender, EventArgs e)
        {
            DialogResult result = EasyDialog.ShowYesNoRestore("Photoshop CS5");
            if (result == DialogResult.Yes)
            {
                try
                {
                    var t = new Thread(frmMain.waitscreen);
                    t.Start();

                    if (Is64)
                    {
                        string chkfile_64 = Program_64 + @"\Adobe\Adobe Photoshop CS5 (64 Bit)\Photoshop.exe";
                        string chkfile_32 = Program_32 + @"\Adobe\Photoshop cs5\Photoshop.exe";
                        if (File.Exists(chkfile_64) || File.Exists(chkfile_32))
                        {
                            foreach (Process app in Process.GetProcesses())
                                if (app.ProcessName == "photoshop")
                                    app.Kill();
                            string rar_file = App_path + @"\DBBACKUP\Photoshop\PTSCS5.rar";
                            string path_file = Roaming_path +
                                               @"\Adobe\Adobe Photoshop CS5\Adobe Photoshop CS5 Settings\";
                            EasyRAR.Extract(rar_file, path_file);

                            t.Abort();
                            MessageBox.Show("Restore completed!", "Finish");
                        }
                        else
                        {
                            t.Abort();
                            MessageBox.Show("Adobe Photoshop CS5 don't install!", "Error");
                        }
                    }
                    else
                    {
                        string chkfile_32 = Program_32 + @"\Adobe\Photoshop cs5\Photoshop.exe";
                        if (File.Exists(chkfile_32))
                        {
                            foreach (Process app in Process.GetProcesses())
                                if (app.ProcessName == "photoshop")
                                    app.Kill();
                            string rar_file = App_path + @"\DBBACKUP\Photoshop\PTSCS5.rar";
                            string path_file = Roaming_path +
                                               @"\Adobe\Adobe Photoshop CS5\Adobe Photoshop CS5 Settings\";
                            EasyRAR.Extract(rar_file, path_file);

                            t.Abort();
                            MessageBox.Show("Restore completed!", "Finish");
                        }
                        else
                        {
                            t.Abort();
                            MessageBox.Show("Adobe Photoshop CS5 don't install!", "Error");
                        }
                    }
                }
                catch
                {
                    MessageBox.Show("Error! Please contact: caiwindao@outlook.com", "Error");
                }
            }
        }

        private void btn_bk_cs6_Click(object sender, EventArgs e)
        {
            DialogResult result = EasyDialog.ShowYesNoBackup("Photoshop CS6");
            if (result == DialogResult.Yes)
            {
                if (File.Exists(App_path + @"\DBBACKUP\Photoshop") != true)
                {
                    Directory.CreateDirectory(App_path + @"\DBBACKUP\Photoshop");
                }
                try
                {
                    var t = new Thread(frmMain.waitscreen);
                    t.Start();

                    if (Is64)
                    {
                        string chkfile_64 = Program_64 + @"\Adobe\Adobe Photoshop CS6 (64 Bit)\Photoshop.exe";
                        string chkfile_32 = Program_32 + @"\Adobe\Photoshop CS6\Photoshop.exe";
                        if (File.Exists(chkfile_64) || File.Exists(chkfile_32))
                        {
                            foreach (Process app in Process.GetProcesses())
                                if (app.ProcessName == "photoshop")
                                    app.Kill();
                            string rar_file = App_path + @"\DBBACKUP\Photoshop\PTSCS6.rar";
                            string path_file = Roaming_path +
                                               @"\Adobe\Adobe Photoshop CS6\Adobe Photoshop CS6 Settings\";
                            EasyRAR.Compress(rar_file, path_file);

                            t.Abort();
                            MessageBox.Show("Backup completed!", "Finish");
                        }
                        else
                        {
                            t.Abort();
                            MessageBox.Show("Adobe Photoshop CS6 don't install!", "Error");
                        }
                    }
                    else
                    {
                        string chkfile_32 = Program_32 + @"\Adobe\Photoshop CS6\Photoshop.exe";
                        if (File.Exists(chkfile_32))
                        {
                            foreach (Process app in Process.GetProcesses())
                                if (app.ProcessName == "photoshop")
                                    app.Kill();
                            string rar_file = App_path + @"\DBBACKUP\Photoshop\PTSCS6.rar";
                            string path_file = Roaming_path +
                                               @"\Adobe\Adobe Photoshop CS6\Adobe Photoshop CS6 Settings\";
                            EasyRAR.Compress(rar_file, path_file);

                            t.Abort();
                            MessageBox.Show("Backup completed!", "Finish");
                        }
                        else
                        {
                            t.Abort();
                            MessageBox.Show("Adobe Photoshop CS6 don't install!", "Error");
                        }
                    }
                }
                catch
                {
                    MessageBox.Show("Error! Please contact: caiwindao@outlook.com", "Error");
                }
            }
        }

        private void btn_res_cs6_Click(object sender, EventArgs e)
        {
            DialogResult result = EasyDialog.ShowYesNoRestore("Photoshop CS5");
            if (result == DialogResult.Yes)
            {
                try
                {
                    var t = new Thread(frmMain.waitscreen);
                    t.Start();

                    if (Is64)
                    {
                        string chkfile_64 = Program_64 + @"\Adobe\Adobe Photoshop CS6 (64 Bit)\Photoshop.exe";
                        string chkfile_32 = Program_32 + @"\Adobe\Photoshop CS6\Photoshop.exe";
                        if (File.Exists(chkfile_64) || File.Exists(chkfile_32))
                        {
                            foreach (Process app in Process.GetProcesses())
                                if (app.ProcessName == "photoshop")
                                    app.Kill();
                            string rar_file = App_path + @"\DBBACKUP\Photoshop\PTSCS6.rar";
                            string path_file = Roaming_path +
                                               @"\Adobe\Adobe Photoshop CS6\Adobe Photoshop CS6 Settings\";
                            EasyRAR.Extract(rar_file, path_file);

                            t.Abort();
                            MessageBox.Show("Restore completed!", "Finish");
                        }
                        else
                        {
                            t.Abort();
                            MessageBox.Show("Adobe Photoshop CS6 don't install!", "Error");
                        }
                    }
                    else
                    {
                        string chkfile_32 = Program_32 + @"\Adobe\Photoshop CS6\Photoshop.exe";
                        if (File.Exists(chkfile_32))
                        {
                            foreach (Process app in Process.GetProcesses())
                                if (app.ProcessName == "photoshop")
                                    app.Kill();
                            string rar_file = App_path + @"\DBBACKUP\Photoshop\PTSCS6.rar";
                            string path_file = Roaming_path +
                                               @"\Adobe\Adobe Photoshop CS6\Adobe Photoshop CS6 Settings\";
                            EasyRAR.Extract(rar_file, path_file);

                            t.Abort();
                            MessageBox.Show("Restore completed!", "Finish");
                        }
                        else
                        {
                            t.Abort();
                            MessageBox.Show("Adobe Photoshop CS6 don't install!", "Error");
                        }
                    }
                }
                catch
                {
                    MessageBox.Show("Error! Please contact: caiwindao@outlook.com", "Error");
                }
            }
        }

        private void btn_bk_ptscc_Click(object sender, EventArgs e)
        {
            DialogResult result = EasyDialog.ShowYesNoBackup("Photoshop CS CC");
            if (result == DialogResult.Yes)
            {
                if (File.Exists(App_path + @"\DBBACKUP\Photoshop") != true)
                {
                    Directory.CreateDirectory(App_path + @"\DBBACKUP\Photoshop");
                }
                try
                {
                    var t = new Thread(frmMain.waitscreen);
                    t.Start();

                    if (Is64)
                    {
                        string chkfile_64 = Program_64 + @"\Adobe\Adobe Photoshop CC (64 Bit)\Photoshop.exe";
                        string chkfile_32 = Program_32 + @"\Adobe\Photoshop CC\Photoshop.exe";
                        if (File.Exists(chkfile_64) || File.Exists(chkfile_32))
                        {
                            foreach (Process app in Process.GetProcesses())
                                if (app.ProcessName == "photoshop")
                                    app.Kill();
                            string rar_file = App_path + @"\DBBACKUP\Photoshop\PTSCC.rar";
                            string path_file = Roaming_path + @"\Adobe\Adobe Photoshop CC\Adobe Photoshop CC Settings\";
                            EasyRAR.Compress(rar_file, path_file);

                            t.Abort();
                            MessageBox.Show("Backup completed!", "Finish");
                        }
                        else
                        {
                            t.Abort();
                            MessageBox.Show("Adobe Photoshop CC don't install!", "Error");
                        }
                    }
                    else
                    {
                        string chkfile_32 = Program_32 + @"\Adobe\Photoshop CC\Photoshop.exe";
                        if (File.Exists(chkfile_32))
                        {
                            foreach (Process app in Process.GetProcesses())
                                if (app.ProcessName == "photoshop")
                                    app.Kill();
                            string rar_file = App_path + @"\DBBACKUP\Photoshop\PTSCC.rar";
                            string path_file = Roaming_path + @"\Adobe\Adobe Photoshop CC\Adobe Photoshop CC Settings\";
                            EasyRAR.Compress(rar_file, path_file);

                            t.Abort();
                            MessageBox.Show("Backup completed!", "Finish");
                        }
                        else
                        {
                            t.Abort();
                            MessageBox.Show("Adobe Photoshop CC don't install!", "Error");
                        }
                    }
                }
                catch
                {
                    MessageBox.Show("Error! Please contact: caiwindao@outlook.com", "Error");
                }
            }
        }

        private void btn_res_ptscc_Click(object sender, EventArgs e)
        {
            DialogResult result = EasyDialog.ShowYesNoRestore("Photoshop CS CC");
            if (result == DialogResult.Yes)
            {
                try
                {
                    var t = new Thread(frmMain.waitscreen);
                    t.Start();

                    if (Is64)
                    {
                        string chkfile_64 = Program_64 + @"\Adobe\Adobe Photoshop CC (64 Bit)\Photoshop.exe";
                        string chkfile_32 = Program_32 + @"\Adobe\Photoshop CC\Photoshop.exe";
                        if (File.Exists(chkfile_64) || File.Exists(chkfile_32))
                        {
                            foreach (Process app in Process.GetProcesses())
                                if (app.ProcessName == "photoshop")
                                    app.Kill();
                            string rar_file = App_path + @"\DBBACKUP\Photoshop\PTSCC.rar";
                            string path_file = Roaming_path + @"\Adobe\Adobe Photoshop CC\Adobe Photoshop CC Settings\";
                            EasyRAR.Extract(rar_file, path_file);

                            t.Abort();
                            MessageBox.Show("Restore completed!", "Finish");
                        }
                        else
                        {
                            t.Abort();
                            MessageBox.Show("Adobe Photoshop CC don't install!", "Error");
                        }
                    }
                    else
                    {
                        string chkfile_32 = Program_32 + @"\Adobe\Photoshop CC\Photoshop.exe";
                        if (File.Exists(chkfile_32))
                        {
                            foreach (Process app in Process.GetProcesses())
                                if (app.ProcessName == "photoshop")
                                    app.Kill();
                            string rar_file = App_path + @"\DBBACKUP\Photoshop\PTSCC.rar";
                            string path_file = Roaming_path + @"\Adobe\Adobe Photoshop CC\Adobe Photoshop CC Settings\";
                            EasyRAR.Extract(rar_file, path_file);

                            t.Abort();
                            MessageBox.Show("Restore completed!", "Finish");
                        }
                        else
                        {
                            t.Abort();
                            MessageBox.Show("Adobe Photoshop CC don't install!", "Error");
                        }
                    }
                }
                catch
                {
                    MessageBox.Show("Error! Please contact: caiwindao@outlook.com", "Error");
                }
            }
        }

        private void btn_bk_neat6_Click(object sender, EventArgs e)
        {
            DialogResult result = EasyDialog.ShowYesNoBackup("NeatImage 6.0");
            if (result == DialogResult.Yes)
            {
                if (File.Exists(App_path + @"\DBBACKUP\Neatimage") != true)
                {
                    Directory.CreateDirectory(App_path + @"\DBBACKUP\Neatimage");
                }
                try
                {
                    var t = new Thread(frmMain.waitscreen);
                    t.Start();

                    string chkfile_32 = Program_32 + @"\Neat Image\NeatImage.exe";
                    if (File.Exists(chkfile_32))
                    {
                        foreach (Process app in Process.GetProcesses())
                            if (app.ProcessName == "NeatImage")
                                app.Kill();
                        string rar_file = App_path + @"\DBBACKUP\Neatimage\Neat.rar";
                        string path_file = Roaming_path + @"\Neat Image\PRESETS\";
                        EasyRAR.Compress(rar_file, path_file);

                        t.Abort();
                        MessageBox.Show("Backup completed!", "Finish");
                    }
                    else
                    {
                        t.Abort();
                        MessageBox.Show("Neatimage 6 don't install!", "Error");
                    }
                }
                catch
                {
                    MessageBox.Show("Error! Please contact: caiwindao@outlook.com", "Error");
                }
            }
        }

        private void btn_res_neat6_Click(object sender, EventArgs e)
        {
            DialogResult result = EasyDialog.ShowYesNoRestore("NeatImage 6.0");
            if (result == DialogResult.Yes)
            {
                try
                {
                    var t = new Thread(frmMain.waitscreen);
                    t.Start();

                    string chkfile_32 = Program_32 + @"\Neat Image\NeatImage.exe";
                    if (File.Exists(chkfile_32))
                    {
                        foreach (Process app in Process.GetProcesses())
                            if (app.ProcessName == "NeatImage")
                                app.Kill();
                        string rar_file = App_path + @"\DBBACKUP\Neatimage\Neat.rar";
                        string path_file = Roaming_path + @"\Neat Image\PRESETS\";
                        EasyRAR.Extract(rar_file, path_file);

                        t.Abort();
                        MessageBox.Show("Restore completed!", "Finish");
                    }
                    else
                    {
                        t.Abort();
                        MessageBox.Show("Neatimage 6 don't install!", "Error");
                    }
                }
                catch
                {
                    MessageBox.Show("Error! Please contact: caiwindao@outlook.com", "Error");
                }
            }
        }
    }
}